<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body padding-left-40">

        <label class="layui-form-item block relative">
            <span class="color-green font-w7 label-required-prev">折扣方案名称</span>
            <span class="color-desc margin-left-5">Discount Name</span>
            <input class="layui-input" name="name" required value="{$vo.name|default=''}" placeholder="请输入折扣方案名称">
        </label>

        <div class="layui-form-item">
            <span class="color-green font-w7 label-required-prev">用户级别折扣</span>
            <span class="color-desc margin-left-5">Discount Scheme</span>
            <table class="layui-table think-level-box" lay-skin="line">
                <thead>
                <tr>
                    <th class="text-left">会员级别</th>
                    <th class="text-right" style="width:150px">原价比例</th>
                </tr>
                </thead>
                <tbody>
                {foreach $levels as $level}
                <tr class="think-bg-white">
                    <td class="nowrap notselect sub-span-blue">
                        [ <span>VIP{$level.number|default='0'}</span> ] {$level.name|default=''}
                    </td>
                    <td class="nowrap padding-0">
                        <label>
                            {php} $key = "_level_" . $level['number']; {/php}
                            <input name="_level_{$level.number}" data-blur-number="4" value="{$vo[$key]??'100.0000'}" placeholder="请输入用户级别折扣"> %
                        </label>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>

        <label class="layui-form-item block relative">
            <span class="color-green font-w7 label-required-prev">折扣方案备注</span>
            <span class="color-desc margin-left-5">Discount Remark</span>
            <textarea name="remark" class="layui-textarea" placeholder="请输入折扣方案备注">{$vo.remark|default=''}</textarea>
        </label>

        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

        <div class="layui-form-item text-center">
            <button class="layui-btn" type='submit'>保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>
    </div>

</form>

<script>layui.form.render()</script>
<style>
    .think-level-box tr input {
        width: 90%;
        height: 38px;
        border: none;
        text-align: right;
        line-height: 38px;
    }
</style>


